import 'package:flutter/material.dart';
import 'package:kasax/utils/sp_utils.dart';

/// 全局初始化工具类
class GlobalUils {
  static void globalInit(VoidCallback renderUICallback,
      {VoidCallback? beforeRenderUICallback,
      VoidCallback? afterRenderUICallback}) async {
    /// 必须 要初始化，否则 会报错
    WidgetsFlutterBinding.ensureInitialized();
    await SPUtils.getInstance();
    beforeRenderUICallback!.call();
    renderUICallback.call();
    afterRenderUICallback!.call();
  }
}
